export class lungCancerInfo {
    static ctPurposeAry = [{
        id: 1,
        name:"基线筛查"
    },{
        id: 2,
        name:"年度筛查" 
    },{
        id: 3,
        name:"阳性复查" 
    }]

    static screeningTypeAry = [{
        id: 1,
        name:"初筛"
    },{
        id: 2,
        name:"随访" 
    }]

    static searchForm = function(){
        return {
            province_id: "",
            city_id: "",
            district_id: "",
            town_id: "",
            village_id: "",
            institution_id: "",
            name: "",
            sfz: "",
            ct_date:"",
            status: "",
            screening_type: "",
            ct_objective: "",
            is_lung_cancer: ""   
        }
    }

    static getparm(page){
        return {
            pageSize: page.pageSize,
            page: page.page,
            province_id: page.searchForm.province_id,
            city_id: page.searchForm.city_id,
            district_id: page.searchForm.district_id,
            town_id: page.searchForm.town_id,
            village_id: page.searchForm.village_id,
            institution_id: page.searchForm.institution_id,
            name: page.searchForm.name,
            sfz: page.searchForm.sfz,
            is_lung_cancer: page.searchForm.is_lung_cancer,
            ct_date: page.searchForm.ct_date,
            status: page.searchForm.status,
            screening_type: page.searchForm.screening_type,
            ct_objective: page.searchForm.ct_objective,
            uid: page.$store.state.member.uid,
        }
    }

    static findOpt(id, ary) {
        let result =  ary.find(v=>{
            return id == v.id
        })
        return result != null ? result.name: "未知"
    }

    static getCtPurposeName(id) {
        return this.findOpt(id, this.ctPurposeAry)
    }

    static getScreeningTypeName(id) {
        return this.findOpt(id, this.screeningTypeAry)
    }
}